import { ref } from 'vue'
export default {
    namespaced: true,
    state:()=>( {
        leftMenuCollapse: false,
        menuLoadStatus: false,
        menus: []
    }),
    getters: {
        getLeftMenuCollapse(state) {
            return state.leftMenuCollapse;
        },
        getMenuLoadStatus(state) {
            return state.menuLoadStatus;
        },
        getMenus(state) {
            return state.menus;
        },
        getMenuByPath(state, path){
            console.log('getMenuByPath', path);
            return 0;
        }
    },
    mutations: {
        collapseLeftMenu(state, val) {
            state.leftMenuCollapse = val;
        },
        setMenus(state, val) {
            state.menus = val;
        },
        setMenuLoadStatus(state, val) {
            state.menuLoadStatus = val;
        }
    },
    actions: {
        collapseLeftMenu({ commit }, val) {
            commit('collapseLeftMenu', val);
        },
        setMenus({ commit }, val) {
            commit('setMenus',val);
        },
        setMenuLoadStatus({ commit }, val) {
            commit('setMenuLoadStatus', val);
        }
    },
}